package demo10;

import org.springframework.context.annotation.AnnotationConfigApplicationContext;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;

/**
 * Spring提供了一个注解：
 * @Configuration :表示为一个配置类
 *
 * @ComponentScan("demo10")
 * 告知Spring容器扫描那个包中的类进行管理
 */

@Configuration
@ComponentScan("demo10")
public class Demo {
    public static void main(String[] args) {
        AnnotationConfigApplicationContext context=
                new AnnotationConfigApplicationContext(Demo.class);
        Person person=context.getBean(Person.class);
        System.out.println(person);
    }
}
